package com.mbyte.easy.zfbPay.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author zte
 * @since 2021/1/28 15:10
 */
public class AlipayConfig {

    /**
     * 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
     */
    public static String APP_ID = "2021000117606301";

    /**
     * 商户私钥，您的PKCS8格式RSA2私钥，这些就是我们刚才设置的
     */
    public static String MERCHANT_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDsPo9nU79lMRWvrBQqk6W7sYLM9s+8Y0zloouGbTCTezxToDv3IwLsjzy0YbJ3SdiZZxRwEX2xriAGwwA9PdcjpNHEktjfvoIg3g4xD4ZYaxlrwhnpGYADd+0ef/QRyhD+JOvEB555mnfZFWP65/DhzOQi/upsL5ABx3LF57OUYzgnPQGkMoe/nCdOdUd6+i4m0jpSCzIk59WGE5h4JCL/AIagcwIHVG5UTnipyCx8TyfnURdn45LbuOm5sJqV7+vDeufQL0xNO6gb8wOScMSUonXKbmwVMXDn6nWikHXha4H8TrApbGz7wEgqL38VMYVVWAgS3NVjnAgzzGTP7C/hAgMBAAECggEBAL4/byqtxb9O9QDgmejjuB7bx9MZm5dBfIadDLF3sxvBrYZGzqOqHUu12hQFbTwlSvnWih3p6AgzinUHimTHLT72FzuvallcyNyBFnqp3u3LadBeopEWSQICDQF312yQBnkz8G2QGS4imAtI75f6OwEMCFiqYsw2zUixfpsjiXmflVn1oB6z/oYke5x1dEPeo3Ip61ycpz+wsHkjqffDBrC9F395x32rhb0LOZpZ7qzVpVaelE99+3OFsuEO6mzOCFeg0ECMcu36DNs/tti0Ikfq4ZTSHJ4710j2sQoaO+ek8cCdcM54xgDfj/tAbpkaKUArBhBiVjZTUJPecXLerMECgYEA97HLtESr3aiMNpoyFjsXjASaUsQ/XgBTy7aRdG0rqGzbuUX1KbDDg1CRiEIIvyfeGtbTtOGaoFhCqIag7FsadH2QyHkkAxv9r1rI3J9xKUI7ek9ZNUX3qIF2h+ICZlqWxqYakesfq6BNhIQ7eNt70TD9rCu9PViAhx5brhKJHakCgYEA9Cp6Cav4jO15JCZeHBR5EDqIW9vkCKnahYVj++5i1e2cz0WFZwfmJpd8yC0smDDcZNgqQDTLIf5bH5OH63IarGw5S2G2RaKCLAJlx7Nqu3TzybXTOXTLNf7dFHh7wSRAxaa3vLBFgZaPTk2x0HuqHmXJREw/Kd+XFViisV5gs3kCgYBOjGyMA0b5aQzl9+owUJb8CS2jV6a8uZ/ZN1FTOZehtrvLOlsv2GV4DCHKsx4w+ISfwEas0uqFNNgWt3Lq4U03aeZzHK+F6Od/J2wRQuLQ8bcI54bjtQd/wWaEWvDl4o5z+pLseUK224QZpRFzFy9hvIaFhe1iOeGwd7kdL7WZ2QKBgHgMAmCK+vNfNrZ9XrvznOpLvQtc+6r+x//p65TMSi/gWb7W8ZYMni3PQXyyKUDSlSnH1k4nJtCZ3HeT87nhKhgoRas4aYOnONUmgKBFKG7uO4arLSUMtXTg0BXmfwIhLu9+3suY5zOlsOPQ82ILy0KSzPgVfOC7m+7U23jVbDoRAoGAO8K1t7QdS1XBAa1DAhoSXGSxODia+c03g6j9teC0zU6UUBdgTZdzSZVMFEF1Jgv0ksFLyOO0ZdHlQkMWQCZiDWIXfmFt4p2VGUsENEx2hxI6YI8hQPsHpbicMiQegQa+qzR64mWpm7R3bjnQq8aC0NrX8s3e6ISRNKIbHGEEZXw=";

    /**
     * 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。，这些就是我们刚才设置的
     */
    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1WQpTHLI9dHXa2QOGHQPMt+fhtoHHi1L79YEizYK6DbWKZEZyoaYjWYr0nW1UuCJ2O1VUkbGeOg4uLQqeX6o8s+nWHNdmjXhSS9XHZ699rP24ZoFhPJcAG1xzmXrYNHjF3I1nRxCafqhJ3509M0WUgBlybn/kDvIgxiNpxOpJ3lf5jFwWRCyyzFQYDkoazAg78yRyK+DICvzC+jUF53Iu/rAwqYutI55wVrudO5qNBDM2afw3FyYCTufDAu5Z51B9w3HMin9yjVFZa52nkmu3lqvNh+6RqFfdGoG9Xv3/nh1B8+h3kc7NK6bG+gdazmHbyNNNwOp58bBivc2sVwGwIDAQAB";

    /**
     * 异步通知，再这里我们设计自己的后台代码
     */
    public static String notify_url = "https://www.baidu.com";

    /**
     * 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
     */
    public static String return_url = "https://www.baidu.com";

    /**
     *  签名方式
     */
    public static String SIGN_TYPE = "RSA2";

    /**
     *  字符编码格式
     */
    public static String CHARSET = "utf-8";

    /**
     * 支付宝网关
     */
    public static String GATEWAYURL = "https://openapi.alipaydev.com/gateway.do";

    /**
     * 支付宝网关
     */
    public static String LOG_PATH = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(LOG_PATH + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
